//
//  YTCouldViewController.m
//  YUNT
//
//  Created by 小萌 on 2017/11/14.
//  Copyright © 2017年 梁炜东. All rights reserved.
//

#import "YTCouldViewController.h"
#import "YTCamerSetCell.h"
#import "YTBeautyHeadView.h"
static NSString *identifier = @"YTCamerSetCell";

@interface YTCouldViewController ()
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) NSArray *array;
@property (nonatomic, strong) YTBeautyHeadView *footerView;

@end

@implementation YTCouldViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"云台";
    // Do any additional setup after loading the view from its nib.
    self.view.backgroundColor = [UIColor colorWithHexString:@"#2e2e2e"];
    [self.tableView registerNib:[UINib nibWithNibName:@"YTCamerSetCell" bundle:nil] forCellReuseIdentifier:identifier];
 
}
- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    self.tableView.tableFooterView = self.footerView;
}
- (YTBeautyHeadView *)footerView
{
    if (!_footerView) {
        _footerView = [YTBeautyHeadView loadViewForNib];
        _footerView.title = @"俯仰轴锁定";
        _footerView.frame = CGRectMake(0, 0, ScreenWidth, 62);
        IMP_BLOCK_SELF(YTCouldViewController);
        _footerView.handler = ^(id sender) {
            if ([sender boolValue] == YES) {
            }else{
            }
        };
    }
    return _footerView;
}

- (NSArray *)array
{
    if (!_array) {
        YTSetModel *model1 = [[YTSetModel alloc] init];
        model1.name = @"情景模式";
        model1.logo = @"";
        _array = @[model1];
    }
    return _array;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.array.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YTCamerSetCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
    [cell cofigWithModel:self.array[indexPath.row]];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 62;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
